#!/usr/bin/env python

import findrox; findrox.version(2, 0, 0)
import rox, os, sys

try:
	__builtins__._ = rox.i18n.translation(os.path.join(rox.app_dir, 'Messages'))
	
	from optparse import OptionParser

	parser = OptionParser()
	parser.add_option("--options",
		action="store_true", dest="options", default=False,
		help="display options dialog")

	parser.add_option("--stop",
		action="store_true", dest="stop", default=False,
		help="Stop Network")

	parser.add_option("--start",
		action="store_true", dest="start", default=False,
		help="Start Network")
		
	(options, args) = parser.parse_args()

	import Wifi
	if options.start:
		import commands
		commands.getstatusoutput(Wifi.NETSTART.value)
	elif options.stop:
		import commands
		commands.getstatusoutput(Wifi.NETSTOP.value)		
	elif options.options:
		rox.edit_options()
		rox.mainloop()
	else:
		rox.info(_("This is a panel applet.  Drag it to your panel to run it."))
except:
	rox.report_exception()
